Skip to content

Updates 2/3: the Inbox's Update button, Update now, What's new - #1833

Merged
backnotprop merged 3 commits into
mainfrom
feat/updates-inbox
Oct 11, 2026
Merged

backnotprop merged 3 commits into
mainfrom
feat/updates-inbox

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Part 2 of 3 of the owner-approved update notices (design .product/approved/plannotator-updates/). Stacked on #1830 (base feat/updates-check); review that first.

What it does

Server (packages/server/inbox-updates.ts, wired into packages/server/inbox.ts):

  • update on health / list model / SSE status grows to { available: true, state, version, current, action, releaseUrl, publishedAt? } (InboxUpdate in core; available + version keep the old shape).
  • States, worked out from the machine: available (a newer release from the shared daily check, nothing installed yet; shown at once, owner's answer 2), updating (update.lock held), ready (the existing binary-on-disk probe), failed (an install the person started exited non-zero; background failures stay out of the sidebar).
  • The long-lived Inbox runs the shared release check on start and each health tick (answers from the 24h cache, so one GitHub request a day per machine; never in a dev build or while PLANNOTATOR_UPDATE_CHECK is off). While updating, it probes the binary every 2 s.
  • Routes: GET /api/inbox/update (dialog facts: flags, command, open sessions, notes summary, failure), POST /api/inbox/update (Update now: startManualUpdate, the same wrapper as auto-update; a second press → 409 update_locked), POST /api/inbox/update/snooze (Remind me tomorrow, server-side, every tab agrees), POST /api/inbox/update/check (Check now), GET /api/inbox/whats-new?version=. POST /api/inbox/settings takes update_check / auto_update. Same-origin + serverSession guards; none answer through the tailnet.
  • updated: the first run on a newer version than the Inbox ran before shows "What's new in X" for that run.

Window (packages/inbox/components/Updates.tsx):

  • The full-width filled Update button replaces the .ib-restart row: tooltip, accessible name, disabled spinner for Updating/Restarting, neutral outline for Failed. No motion besides the spinner (stopped under reduced motion).
  • Update dialog with Update now in the first step (owner's answer 4), the remembered flags, open sessions, the "Install new versions automatically" checkbox (writes autoUpdate, owner's answer 6), Remind me tomorrow. An unmanaged binary gets the command instead.
  • The page that pressed Update now restarts the Inbox when Ready arrives; an unsent reply gets the "Restart the Inbox to finish updating?" guard first.
  • Failed dialog (exit code, log, install command, Try Again); What's new page (#whats-new=X, read-only Viewer, skipped-release highlights); Settings → About (version, last check, Check now, both switches).

Tests

  • packages/server/inbox-updates.test.ts (real Inbox server, stubbed fetch and installer): the button appears on available from one check across many ticks; off via config and env (no request); dev build; unmanaged → copy; Update now runs once, second press locked; cross-site refused; failed only for person-started; snooze; the checkbox route writes autoUpdate; What's new + skipped; "just updated"; the pure state rules.
  • packages/inbox/updates.test.tsx (DOM): button per state, dialog contents, checkbox reports the change and is locked by env, unmanaged dialog, failed dialog.
  • tests/e2e/inbox.spec.ts restart test moved to the new button. Test preloads and the e2e world point PLANNOTATOR_UPDATE_API_URL at a closed loopback port, so no test reaches GitHub.

Screenshots (Playwright against the built window) are in the series summary.

@backnotprop
backnotprop deleted the branch main October 11, 2026 00:27
@backnotprop backnotprop reopened this Oct 11, 2026
@backnotprop
backnotprop changed the base branch from feat/updates-check to main October 11, 2026 00:27
@backnotprop
backnotprop force-pushed the feat/updates-inbox branch 2 times, most recently from 98822e6 to 832ade3 Compare October 11, 2026 00:58
…, What's new

The sidebar shows one filled Update button above Settings as soon as a newer
release is AVAILABLE (the shared daily check, which the long-lived Inbox also
runs), then Updating, Ready (the existing restart-to-update signal), and a
neutral Update failed for an install the person started. The update dialog
has Update now in the first step (POST /api/inbox/update: the same install
wrapper as auto-update, once, under update.lock), Remind me tomorrow (a
server-side 24h snooze), and an Install new versions automatically checkbox
that writes autoUpdate. The Inbox restarts itself once the update it started
is in, asking first when a reply is unsent. What's new is a page with the
release notes; Settings gains About (Check now and both switches).
…owser proof, no real install script in tests

- inbox-tailscale.test.ts: every update route (Update now, snooze, Check
  now, the facts, What's new, the update switches) answers 403 local_only
  through the tailnet and launches or writes nothing.
- inbox-updates.test.ts: another serverSession gets 409 session_mismatch.
- tests/e2e/inbox-updates.spec.ts: a release-version Inbox with a seeded
  update-state.json shows Update, the dialog, and Update now runs a fake
  install script once for that version.
- Test preloads and the e2e world point PLANNOTATOR_INSTALL_SCRIPT_URL at a
  closed loopback port.
- test.yml keeps main's links.test.tsx beside updates.test.tsx; docs name
  the Inbox as a caller of the check.
@backnotprop
backnotprop merged commit bd592a5 into main Oct 11, 2026
32 checks passed
@backnotprop
backnotprop deleted the feat/updates-inbox branch October 11, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant